package com.jt.www.domain.enums.wxb;

import org.apache.commons.lang3.StringUtils;

/**
 * 推广关系状态
 */
public enum PromotionStatusEnum {

    INIT("01", "初始化"),
    NORMAL("02", "正常"),
    RELIEVE("03", "解除");

    /**
     * 状态
     */
    private String status;

    /**
     * 描述
     */
    private String desc;


    PromotionStatusEnum(String status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    /**
     * 通过status得到描述
     *
     * @param status
     * @return
     */
    public static String getDestByStatus(String status) {
        if (StringUtils.isBlank(status)) {
            return "";
        }
        for (PromotionStatusEnum promotionStatusEnum : PromotionStatusEnum.values()) {
            if (promotionStatusEnum.status.equals(status)) {
                return promotionStatusEnum.desc;
            }
        }
        return "";
    }

    public String getStatus() {
        return status;
    }

    public String getDesc() {
        return desc;
    }
}


